Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
Trying to draw a circle using "arc" in javaScript but it's not working

I'm trying to draw a circle in the canvas in javascript but it's not working and I'm not getting an error. I've done it before and it usually works, but for some reason now it isn't. Any help would be highly appreciated.

// VARIABLES
var x = 100 ;
var y = 100;
var r = 50;
var c = 272;
var a = 0.9;

// EXECUTABLE CODE
circle();

// FUNCTION
function circle(x,y,r,c,a){
    ctx.beginPath();
    ctx.arc(x,y,r,0,Math.PI*2);
    ctx.fillStyle = "hsl("+c+", 100%, 50%,"+a+")";
    ctx.fill();
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The reason why it is not working is because you did not pass in the arguments x,y,r,c,a when invoking the circle function. So, do this circle(x,y,r,c,a) and it should work for you.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!